<template>
  <el-dialog
    title="通知企业"
    :visible.sync="noticeVisible"
    width="30%"
    :close-on-click-modal="false"
  >
    <div class="content">
      <el-checkbox v-model="system" disabled>系统消息通知</el-checkbox>
      <p class="subTxt">同时发通知给项目施工方管理账号，责任主体企业账号</p>
      <el-checkbox v-model="note" @change="chooseNotice">短信通知</el-checkbox>
      <p class="subTxt">
        同时发通知给项目施工方负责人手机号，责任主体企业账号保密手机号
      </p>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button @click="cancelPreview">取 消</el-button>
      <el-button type="primary" @click="savePreview" class="saveBtn"
        >确 定</el-button
      >
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: 'noticeDialog',
  props: {
    previewData: {
      type: Object,
    },
  },
  data() {
    return {
      noticeVisible: false,
      system: true,
      note: false,
    }
  },
  methods: {
    showDialog() {
      this.noticeVisible = true
    },
    hideDialog() {
      this.noticeVisible = false
    },
    chooseNotice(val) {
      this.$emit('changeNotice', val)
    },
    //关闭弹出框
    cancelPreview() {
      this.hideDialog()
    },
    savePreview() {
      this.$emit('sure')
      this.hideDialog()
    },
  },
}
</script>

<style scoped lang="less">
.content {
  .subTxt {
    margin-bottom: 8px;
    padding-left: 26px;
    line-height: 18px;
  }
}
/deep/ .el-dialog__footer {
  height: 60px;
}
/deep/ .el-checkbox__input.is-checked + .el-checkbox__label {
  color: #606266;
}

/deep/ .el-checkbox__input.is-checked .el-checkbox__inner {
  border-color: #009588;
  background: #009588;
}
</style>
